package day05;

public class ArrayDemo {
    public static void main(String[] args) {
        /*
        int[] arr = new int[3];
        System.out.println("数组的长度: "+arr.length);
        System.out.println("数组第一个元素的值为"+arr[0]);
        arr[0] = 100;
        arr[1] = 200;
        arr[2] = 300;
        //arr[3] = 400;//运行时会发生下标越界异常
        System.out.println(arr[2]);
        System.out.println(arr[arr.length-1]);*/
        //4.数组的遍历/迭代:从头到尾挨个走一遍
        /*int[] arr =  new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i]=(int)(Math.random()*100);
            System.out.println(arr[i]);
        }*/











    }
}
